

import java.io.IOException;

import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class Test
 */
public class Test extends HttpServlet {
	private static final long serialVersionUID = 1L;
    
	@EJB EJBCreation ejbCreation;
	@EJB EJBSuppression ejbSupp;
	@EJB EJBAcces ejbAcces;
	
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Test() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ejbCreation.createEntreprise("decath", 0, 0,"decathlon");
		String sortie = "nom de l'entreprise: " + ejbAcces.getEntreprise(1).getNom();
		response.setContentType("text/html");
		response.getWriter().println("<html><body><hl>" + sortie + "</hl></body></html>");
		ejbCreation.createEvenementEntreprise("velos","sport",ejbAcces.getEntreprise(1),1000,250);
		ejbSupp.removeEntreprise(1);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
